home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / comm / mail / YAM23src.lha / Source / C_c.sd < prev    next >
Text File  |  2000-12-17  |  1KB  |  43 lines

  1. ##stringtype C
  2. ##shortstrings
  3. /****************************************************************
  4.    This file was created automatically by `FlexCat V1.3'
  5. ****************************************************************/
  6.  
  7. #include <clib/locale_protos.h>
  8.  
  9. static long %b_Version = %v;
  10. static const STRPTR %b_BuiltInLanguage = (STRPTR)%l;
  11. struct FC_Type { long ID; char * Str; };
  12. const struct FC_Type _%i = { %d, %s };
  13. static struct Catalog *%b_Catalog = NULL;
  14.  
  15. void Open%bCatalog(void)
  16. {
  17.     extern struct Library *LocaleBase;
  18.     extern void Close%bCatalog(void);
  19.  
  20.     if (LocaleBase && !%b_Catalog)
  21.       {
  22.          %b_Catalog = OpenCatalog(NULL, (STRPTR)"%b.catalog", OC_BuiltInLanguage, %b_BuiltInLanguage,
  23.           OC_Version, %b_Version, TAG_DONE);
  24.     }
  25. }
  26.  
  27. void Close%bCatalog(void)
  28. {
  29.     extern struct Library *LocaleBase;
  30.       if (LocaleBase) CloseCatalog(%b_Catalog);
  31.       %b_Catalog = NULL;
  32. }
  33.  
  34. char *GetStr(APTR fcstr)
  35. {
  36.    char *defaultstr;
  37.    int strnum;
  38.  
  39.    strnum = ((struct FC_Type *)fcstr)->ID;
  40.    defaultstr = ((struct FC_Type *)fcstr)->Str;
  41.    return %b_Catalog ? (char *)GetCatalogStr(%b_Catalog, strnum, (STRPTR)defaultstr) : defaultstr;
  42. }
  43.